package com.gaoyi.crm.repository;

import com.gaoyi.crm.callback.Callback;
import com.gaoyi.crm.callback.OnResultListener;
import com.gaoyi.crm.util.OKHttpUtil;

import java.lang.reflect.Type;

public class UserRepository {

    public void login(Object bean, OnResultListener onResultListener, Type typeofT) {
        OKHttpUtil.getInstance().postAsync(OKHttpUtil.NET_URL + "/api/users/login", bean, new Callback() {
            @Override
            public void onSuccess(Object obj) {
                onResultListener.onSuccess(obj);
            }

            @Override
            public void onFailed(Exception e) {
                onResultListener.onFails(e);
            }
        }, typeofT);
    }
}
